import { observer } from "mobx-react";
import { toJS } from 'mobx';
import D3Tree from "../../common/tree/RectTree";
import {WeaLocaleProvider} from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;

@observer
export default class DataPath extends React.Component {
    render() {
        const { store } = this.props;
        return (
            <div className="edc-data-path">
                {store.noPath ? <div style={{ fontSize: 16, paddingTop: 100, textAlign: 'center', color: '#ccc' }} >
                    {getLabel('502289','请在左侧选择上报任务') }
                </div> :
                    <D3Tree
                        data={toJS(store.pathNode)}
                        onClick={this.openNode}
                        widthToggle={false}
                        showRight={false}
                        desc="submitDate"
                        showname={this.getShowname}
                    />
                }
            </div>
        )
    }
    
    getShowname = (d) => {
        return `${d.name}`;
    }

}